package com.xzh.test;

public class kaoshi_2 {
    public static void main(String[] args) {
        double a1=1,a2=2,n=0,sum=0;

        for (int i = 0; i < 20; i++) {
            sum+=(a2/a1);
            n=a2;
            a2+=a1;
            a1=n;
        }
        System.out.println("前二十项之和为："+sum);
    }
}
